<?php
require_once 'models/User.php';
require_once 'models/UserMapper.php';
require_once 'models/UseCategoryMapper.php';
class IndexController extends BaseControllerAction {
	
	public function indexAction() {
		// action body
		$guestbook = new Model_UserMapper($this->db);
        $this->view->entries = $guestbook->fetchAll();
        $usecategorymapper = new Model_UseCategoryMapper($this->db);
        $this->view->usecategorys = $usecategorymapper->fetchAll();
	  //  $query = "select * from user";
	    //var_dump($this->db);
		//$resultSet = $this->db->query($query);
//		if(!$resultSet) {
//		   echo mysql_errno() . mysql_error();
//		}
		//$entries = array ();
//		$this->logger->debug(sizeof($resultSet));
//		$this->logger->debug(mysql_fetch_row ($resultSet));
//		while (list ($id, $name) = mysql_fetch_row ($resultSet)) {
//			$this->logger->debug($id . '-' . $name);
//			
//        }
//		
//		foreach ( $resultSet as $row ) {
//			
//			$entry = new User ();
//			$entry->setId ( $row['Id'] );
//			$entry->setName ( $row['name'] );
//			$entries [] = $entry;
//		}
//		$this->view->entries = $entries;
	}
    
	public function usecategoryAction() {
		
		
	}
}

